/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


package portelogiche;

/**
 *
 * @author danielederuschi
 */
import java.io.*;
import org.antlr.runtime.*;

public class main {


    public static void main(String args[]) throws Exception {
        PorteLogicheLexer lex = new PorteLogicheLexer(new ANTLRFileStream(args[0]));
        CommonTokenStream tokens = new CommonTokenStream(lex);
        PorteLogicheParser g = new PorteLogicheParser(tokens);
        PorteLogicheSemantic s = new PorteLogicheSemantic(g);

        try {
            g.expr();
            s.CheckTables();
        } catch (RecognitionException e) {
            e.printStackTrace();
        }
        
       System.out.println( s.msgArrayList.toString());
       System.out.println("Scanner Errors:");
       System.out.println( lex.LexerErrors.toString());
       System.out.println("");
       System.out.println("Parser Errors:");
       System.out.println( g.ParserErrors.toString());
       System.out.println("");
       System.out.println("Semantic Errors:");
       System.out.println( s.SemanticErrors.toString());
        
    }
}
